<template>
  <!-- 钻石节点 -->
  <div class="node_container">
    <slot name="top" />
    <div class="diamond-node">
      <!-- <Handle type="target" :position="Position.Left" /> -->
      <div class="node-content">
        {{ data.label }}
      </div>
      <!-- <Handle type="source" :position="Position.Right" /> -->
    </div>
    <slot name="bottom" />
  </div>
</template>

<script setup lang="ts">
import { Position } from '@vue-flow/core'

console.log(Position)

interface Props {
  id: string
  data: {
    label: string
    nodeType: string
  }
}

defineProps<Props>()
</script>

<style scoped>
.node_container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 115px;
  height: 115px;
}

.diamond-node {
  width: 80px;
  height: 80px;
  background: #fff;
  border: 1px solid #000;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.node-content {
  transform: rotate(-45deg);
  text-align: center;
  font-size: 12px;
  color: #000;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
</style>
